﻿@{
    ViewBag.Title = "View Stock";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/css/jquery.treeview.css" rel="stylesheet" />
<script src="~/js/jquery.treeview.min.js"></script>
<script>
    $(document).ready(function () {
        $("#tree").treeview({
            animated: "fast",
            collapsed: true,
        });
    });
</script>
<div class="container-fluid">
    <form action="/stockcontrol/searchpartviewstock" id="fr-searchpartviewstock">
        <!-- Modal -->
        <div id="groupfilter" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="groupfilter" aria-hidden="true" data-width="800">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
                <h5>Part Group Filter</h5>
            </div>
            <div class="modal-body">
                <div class="row-fluid">
                    <div class="span5">
                        <div class="border-padding10">
                            <div class="group-filter-tree-bg">
                                @Html.Raw(ViewBag.Tree)
                            </div>
                        </div>
                    </div>
                    <div class="span2">
                        <div class="row-fluid" style="margin-top: 50px">
                            <input type="button" class="btn btn-success" value="Add -->>" onclick="AddToGroupFilter()" style="width: 100%" />
                        </div>
                        <div class="row-fluid" style="margin:10px 0">
                            <input type="button" class="btn btn-danger" value="Remove" onclick="removeGroupedFilter()" style="width: 100%" />
                        </div>
                        <div class="row-fluid">
                            <input type="button" class="btn" value="Clear" onclick ="$('#groupedFilter').html('');" style="width: 100%" />
                        </div>
                        <div class="row-fluid" style="margin: 152px 0 10px 0">
                            <input type="button"  data-dismiss="modal"  class="btn btn-primary" value="Ok" style="width: 100%" />
                        </div>
                        <div class="row-fluid">
                            <input type="button" class="btn" value="Cancel" onclick ="$('#groupedFilter').html('');" data-dismiss="modal" style="width: 100%" />
                        </div>
                    </div>
                    <div class="span5">
                        <div class="border-padding10">
                            <ul class="group-filter-tree-bg " id="groupedFilter">

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="border-padding10" style="margin-bottom: 20px">
            <div class="row-fluid">
                <div class="span1">Part ID:</div>
                <div class="span2">
                    <input type="text" name="partid" id="partid" class="input-block-level" />
                </div>
                <div class="span4">
                    <select class="input-block-level" name="stockfilter">
                        <option value="null">All stock</option>
                        <option value="true">Container stock</option>
                        <option value="false">Non container stock</option>
                    </select>
                </div>
                <div class="span2 text-right">Company:</div>
                <div class="span3">
                    @Html.DropDownList("CompanyID", null, new { @class = "input-block-level" })
                </div>
            </div>
            <div class="row-fluid">
                <div class="span1">Part Name:</div>
                <div class="span2">
                    <input type="text" name="partname" class="input-block-level" />
                </div>
                <div class="span2">
                    <a href="#groupfilter" role="button" data-toggle="modal" class="btn btn-primary" style="width: 100%">Group Filter</a>
                </div>
                <div class="span2">
                    <label>
                        <input type="checkbox" name="alluncategorized" class="cbcheck" />
                        All uncategorized</label>
                </div>
                <div class="span2 text-right">Store:</div>
                <div class="span3">
                    @Html.DropDownList("StoreID", null, new { @class = "input-block-level" })
                </div>
            </div>
        </div>
        <div class="allpartviewstock rdm-scroll">
            <table class="table table-bordered table-fix tbl-selected krmtable" data-height="400">
                <thead>
                    
                    <tr>
                        <th></th>
                        <th>PartID</th>
                        <th>PartName</th>
                        <th>GroupName</th>
                        <th>PartCode</th>
                        <th>StockLevel</th>
                        <th>Allocated</th>
                        <th>PickNotLoaded</th>
                        <th>TotalStock</th>
                        <th>ReorderLevel</th>
                        <th>CompanyName</th>
                        <th>SupplierLeadtime</th>
                        <th>StockValue</th>
                        <th>Sutton</th>
                        <th>Tuxford</th>
                        <th>Drayton</th>
                        <th>NumberSold</th>
                        <th>DaysOfStock</th>
                        <th>CustomersWaiting</th>
                        <th>StockArrivalDates</th>
                        <th>IsOnSite</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
        <div class="row-fluid">
            <div class="span7">
                <input type="button" class="btn btn-primary btn-stockcontrol" value="Stock Control" onclick="alert('Please select part')" />
                <input type="button" class="btn btn-primary btn-addorderstock" value="Add Order Stock" onclick="alert('Please select part')" />
                <input type="button" class="btn btn-primary btn-viewpart" value="View Part" onclick="alert('Please select part')" />
                @*<input type="button" class="btn btn-primary" value="View Other Department Parts" />
                <input type="button" class="btn btn-primary" value="Manage Part Groups" />*@
            </div>
            <div class="span3">
                <div class="row-fluid">
                    <div class="span6">
                        <label>
                            <input type="radio" class="cbcheck" name="instock" value="true" />
                            In Stock</label>
                    </div>
                    <div class="span6">
                        <label>
                            <input type="radio" class="cbcheck" name="insite" value="true" />
                            In Site</label>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span6">
                        <label>
                            <input type="radio" class="cbcheck" name="instock" value="false" />
                            Out Stock</label>
                    </div>
                    <div class="span6">
                        <label>
                            <input type="radio" class="cbcheck" name="insite" value="false" />
                            Off Site</label>
                    </div>
                </div>
            </div>
            <div class="span2">
                <input type="submit" class="btn btn-primary" value="Display Parts" />
            </div>
        </div>
    </form>
</div>


